package cn.hanyx.coder.design.paradigm.lod.demo01;

/**
 * DocumentFactory
 *
 * @author hanyx
 * @date 2020/07/08
 */
public class DocumentFactory {
    private HtmlDownloader downloader;

    public DocumentFactory(HtmlDownloader downloader) {
        this.downloader = downloader;
    }

    public Document createDocument(String url) {
        Html html = downloader.downloadHtml(url);
        return new Document(url, html);
    }
}
